import 'package:HAHA/routers/router.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'package:provider/provider.dart';

import 'config/nav_key.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
  SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
  SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
    systemNavigationBarColor: Colors.transparent,
    systemNavigationBarDividerColor: Colors.transparent,
    statusBarColor: Colors.transparent,
  ));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flower',
      navigatorKey: NavKey.navKey,
      debugShowCheckedModeBanner: false,
      // 移除 DEBUG 标签
      theme: ThemeData(
        primarySwatch: Colors.blue,
        fontFamily: 'HarmonyOS',
      ),
      initialRoute: '/',
      onGenerateRoute: routeGenerator,
    );
  }
}
